local skel = fk.CreateSkill {
  name = "efengqi__hanzhan",
}

Fk:loadTranslationTable{
  ["efengqi__hanzhan"] = "酣战",
  [":efengqi__hanzhan"] = "出牌阶段限一次，你可以令任意名其他角色依次视为对你使用一张【决斗】，然后你视为对未对你造成伤害的角色使用【杀】。",

  ["#efengqi__hanzhan"] = "酣战：令任意名角色视为对你使用【决斗】，再视为对未对你造成伤害的角色使用【杀】。",

  ["$efengqi__hanzhan1"] = "酒酣肝胆，且来一战。",
  ["$efengqi__hanzhan2"] = "气勇胆烈，战则无畏！",
}

skel:addEffect("active", {
  anim_type = "offensive",
  prompt = "#efengqi__hanzhan",
  card_num = 0,
  min_target_num = 1,
  card_filter = Util.FalseFunc,
  target_filter = function (self, player, to, selected, selected_cards)
    local card = Fk:cloneCard("duel")
    card.skillName = skel.name
    return player ~= to and to:canUseTo(card, player)
  end,
  times = function (self, player)
    return 1 - player:usedSkillTimes(skel.name, Player.HistoryPhase)
  end,
  can_use = function(self, player)
    return player:usedSkillTimes(skel.name, Player.HistoryPhase) == 0
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    room:sortByAction(effect.tos)
    local tos = table.simpleClone(effect.tos)
    local victims = {}
    for _, to in ipairs(tos) do
      if player.dead then break end
      if not to.dead then
        local use = room:useVirtualCard("duel", nil, to, player, skel.name)
        if not (use and use.damageDealt and use.damageDealt[player]) then
          table.insert(victims, to)
        end
      end
    end
    if player.dead then return end
    victims = table.filter(victims, function(v) return not v.dead end)
    if #victims > 0 then
      room:useVirtualCard("slash", nil, player, victims, skel.name, true)
    end
  end,
})



return skel
